﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Smart.Service
{
    /// <summary>
    /// 抽象基类，实现服务执行接口
    /// </summary>
    public abstract class ServiceAction : IServiceAction
    {
        /// <summary>
        /// 服务执行
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public IServiceResult Execute(IServiceRequest request, IServiceResult result)
        {
            return DefaultExecute(request, result);
        }

        /// <summary>
        /// 抽象方法，实现类必须实现默认执行方法
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        protected abstract IServiceResult DefaultExecute(IServiceRequest request, IServiceResult result);
    }
}
